window.onload = function(){
    if (typeof loaded == 'function') {
        loaded();
    }
    // 随机红包金额
    var moneyArray = new Array("32.68","36.61","28.56","26.82","41.08","25.36","44.86","56.28","46.29","58.26");
    var sjs = parseInt(Math.random()*moneyArray.length);
    var moneynum = moneyArray[sjs];
    document.querySelector("#moneyNum").innerHTML = (moneynum);

    //显示领取人列表
    var user_sjs = parseInt(Math.random()*10+10);
    var newList=list.sort(()=>0.5-Math.random()).slice(0,user_sjs);
    for(var i=0; i<newList.length; i++){
        var img = newList[i].headimg;
        var name = newList[i].headname;
        var time = newList[i].time;
        var money = newList[i].money;
        showPersonList(img,name,time,money)
    }

    // 获取领取人数
    document.querySelector("#number").innerHTML = (user_sjs);

    // 剩余红包个数
    var sy = 100-parseInt(document.querySelector("#number").innerHTML);
    console.log(sy);

}
//随机领取人列表
function showPersonList(img,name,time,money){
    var user = '';
    user += '<li>';
    user += '<div class="user_infor">';
    user += '<img src="'+img+'" class="head_img">';
    user += '<div class="user_name"><p>'+name+'<\/p><span>'+time+'<\/span><\/div>';
    user += '<\/div>';
    user += '<div class="money">'+money+'元<\/div>';
    user += '<\/li>';
    var u = $(".user_infor");
    $(".result_list ul").append($(user))
}

// 点击领取红包
/* function clickGetHb(){
	$(".pop_share").show();
	$('#lq1').show();
} */

// var list=[{headimg:"https://hahaha-static-file.oss-cn-shenzhen.aliyuncs.com/hb/20190428/img/1.jpg",headname:"~陪伴你",time:"09:30",money:"26.86"},{headimg:"https://hahaha-static-file.oss-cn-shenzhen.aliyuncs.com/hb/20190428/img/2.jpg",headname:"AllWay",time:"10:34",money:"36.05"},{headimg:"https://hahaha-static-file.oss-cn-shenzhen.aliyuncs.com/hb/20190428/img/3.jpg",headname:"鬼鬼",time:"13:09",money:"45.68"},{headimg:"https://hahaha-static-file.oss-cn-shenzhen.aliyuncs.com/hb/20190428/img/4.jpg",headname:"农夫山泉",time:"13:34",money:"32.16"},{headimg:"https://hahaha-static-file.oss-cn-shenzhen.aliyuncs.com/hb/20190428/img/5.jpg",headname:"鸿雁高飞",time:"14:58",money:"38.88"},{headimg:"https://hahaha-static-file.oss-cn-shenzhen.aliyuncs.com/hb/20190428/img/6.jpg",headname:"小可爱",time:"15:27",money:"28.22"},{headimg:"https://hahaha-static-file.oss-cn-shenzhen.aliyuncs.com/hb/20190428/img/7.jpg",headname:"随行者",time:"16:11",money:"46.93"},{headimg:"https://hahaha-static-file.oss-cn-shenzhen.aliyuncs.com/hb/20190428/img/8.jpg",headname:"大华@",time:"16:10",money:"40.82"},{headimg:"https://hahaha-static-file.oss-cn-shenzhen.aliyuncs.com/hb/20190428/img/9.jpg",headname:"Single Girl",time:"18:59",money:"35.69"},{headimg:"https://hahaha-static-file.oss-cn-shenzhen.aliyuncs.com/hb/20190428/img/10.jpg",headname:"陌陌",time:"19:01",money:"36.16"},{headimg:"https://hahaha-static-file.oss-cn-shenzhen.aliyuncs.com/hb/20190428/img/11.jpg",headname:"阳光女孩",time:"19:20",money:"48.91"},{headimg:"https://hahaha-static-file.oss-cn-shenzhen.aliyuncs.com/hb/20190428/img/12.jpg",headname:"三少爷",time:"19:29",money:"33.15"},{headimg:"https://hahaha-static-file.oss-cn-shenzhen.aliyuncs.com/hb/20190428/img/13.jpg",headname:"酷哥",time:"19:47",money:"41.28"},{headimg:"https://hahaha-static-file.oss-cn-shenzhen.aliyuncs.com/hb/20190428/img/14.jpg",headname:"你的心肝",time:"19:56",money:"59.65"},{headimg:"https://hahaha-static-file.oss-cn-shenzhen.aliyuncs.com/hb/20190428/img/15.jpg",headname:"恋曲1998",time:"20:28",money:"52.39"},{headimg:"https://hahaha-static-file.oss-cn-shenzhen.aliyuncs.com/hb/20190428/img/16.jpg",headname:"青青河边草",time:"20:37",money:"35.26"},{headimg:"https://hahaha-static-file.oss-cn-shenzhen.aliyuncs.com/hb/20190428/img/17.jpg",headname:"无事",time:"20:41",money:"46.09"},{headimg:"https://hahaha-static-file.oss-cn-shenzhen.aliyuncs.com/hb/20190428/img/18.jpg",headname:"倾城之恋",time:"20:45",money:"37.66"},{headimg:"https://hahaha-static-file.oss-cn-shenzhen.aliyuncs.com/hb/20190428/img/19.jpg",headname:"北方的狼",time:"21:19",money:"48.62"},{headimg:"https://hahaha-static-file.oss-cn-shenzhen.aliyuncs.com/hb/20190428/img/20.jpg",headname:"小哥哥",time:"21:54",money:"37.92"}]
var list=[{
    headimg: "https://hahaha-static-file.oss-cn-shenzhen.aliyuncs.com/hb/20190428/img/1.jpg",
    headname: "~陪伴你",
    time: "09:30",
    money: "26.86"
}, {
    headimg: "https://hahaha-static-file.oss-cn-shenzhen.aliyuncs.com/hb/20190428/img/2.jpg",
    headname: "AllWay",
    time: "10:34",
    money: "36.05"
}, {
    headimg: "https://hahaha-static-file.oss-cn-shenzhen.aliyuncs.com/hb/20190428/img/3.jpg",
    headname: "鬼鬼",
    time: "13:09",
    money: "45.68"
}, {
    headimg: "https://hahaha-static-file.oss-cn-shenzhen.aliyuncs.com/hb/20190428/img/4.jpg",
    headname: "农夫山泉",
    time: "13:34",
    money: "32.16"
}, {
    headimg: "https://hahaha-static-file.oss-cn-shenzhen.aliyuncs.com/hb/20190428/img/5.jpg",
    headname: "鸿雁高飞",
    time: "14:58",
    money: "38.88"
}, {
    headimg: "https://hahaha-static-file.oss-cn-shenzhen.aliyuncs.com/hb/20190428/img/6.jpg",
    headname: "小可爱",
    time: "15:27",
    money: "28.22"
}, {
    headimg: "https://hahaha-static-file.oss-cn-shenzhen.aliyuncs.com/hb/20190428/img/7.jpg",
    headname: "随行者",
    time: "16:11",
    money: "46.93"
}, {
    headimg: "https://hahaha-static-file.oss-cn-shenzhen.aliyuncs.com/hb/20190428/img/8.jpg",
    headname: "大华@",
    time: "16:10",
    money: "40.82"
}, {
    headimg: "https://hahaha-static-file.oss-cn-shenzhen.aliyuncs.com/hb/20190428/img/9.jpg",
    headname: "Single Girl",
    time: "18:59",
    money: "35.69"
}, {
    headimg: "https://hahaha-static-file.oss-cn-shenzhen.aliyuncs.com/hb/20190428/img/10.jpg",
    headname: "陌陌",
    time: "19:01",
    money: "36.16"
}, {
    headimg: "https://hahaha-static-file.oss-cn-shenzhen.aliyuncs.com/hb/20190428/img/11.jpg",
    headname: "阳光女孩",
    time: "19:20",
    money: "48.91"
}, {
    headimg: "https://hahaha-static-file.oss-cn-shenzhen.aliyuncs.com/hb/20190428/img/12.jpg",
    headname: "三少爷",
    time: "19:29",
    money: "33.15"
}, {
    headimg: "https://hahaha-static-file.oss-cn-shenzhen.aliyuncs.com/hb/20190428/img/13.jpg",
    headname: "酷哥",
    time: "19:47",
    money: "41.28"
}, {
    headimg: "https://hahaha-static-file.oss-cn-shenzhen.aliyuncs.com/hb/20190428/img/14.jpg",
    headname: "你的心肝",
    time: "19:56",
    money: "59.65"
}, {
    headimg: "https://hahaha-static-file.oss-cn-shenzhen.aliyuncs.com/hb/20190428/img/15.jpg",
    headname: "恋曲1998",
    time: "20:28",
    money: "52.39"
}, {
    headimg: "https://hahaha-static-file.oss-cn-shenzhen.aliyuncs.com/hb/20190428/img/16.jpg",
    headname: "青青河边草",
    time: "20:37",
    money: "35.26"
}, {
    headimg: "https://hahaha-static-file.oss-cn-shenzhen.aliyuncs.com/hb/20190428/img/17.jpg",
    headname: "无事",
    time: "20:41",
    money: "46.09"
}, {
    headimg: "https://hahaha-static-file.oss-cn-shenzhen.aliyuncs.com/hb/20190428/img/18.jpg",
    headname: "倾城之恋",
    time: "20:45",
    money: "37.66"
}, {
    headimg: "https://hahaha-static-file.oss-cn-shenzhen.aliyuncs.com/hb/20190428/img/19.jpg",
    headname: "北方的狼",
    time: "21:19",
    money: "48.62"
}, {
    headimg: "https://hahaha-static-file.oss-cn-shenzhen.aliyuncs.com/hb/20190428/img/20.jpg",
    headname: "小哥哥",
    time: "21:54",
    money: "37.92"
}];